﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using TripLOA.WebService.Wrappers;

namespace TripLOA.WebService.Serializable
{
    
    /// <summary>
    /// Class that represents a WebService FullTrip: a serializable sequence of trips with relative proprieties.
    /// </summary>
    /// 
    
    [DataContract]
    public class WSFullTrip : WSObject
    {
        #region Constructors
        /// <summary>
        /// Parameterless Costructor. Set status to "fail"
        /// </summary> 
        public WSFullTrip()
            : this("fail")
        { }

        /// <summary>
        /// Default Costructor. Set status to given value
        /// </summary>
        /// <param name="status">Status string, accepted values are "ok" or "fail"</param>
        public WSFullTrip(string status)
        {
            this.Status = status;
            this.Payload = new List<FullTripInfo>();
        }

        /// <summary>
        /// Costructor. Adds to the payload a FullTripInfo object
        /// </summary>
        /// <param name="status">Status string, accepted values are "ok" or "fail"</param>
        /// <param name="t">FullTripInfo object</param>
        public WSFullTrip(string status, FullTripInfo t)
            : this(status)
        {
            this.Payload.Add(t);
        }
    #endregion

        #region Properties

        /// <summary>
        /// Payload contains a list of GeoRef.GeoLoc objects
        /// </summary>
        [DataMember]
        public List<FullTripInfo> Payload { get; set; }
        #endregion
    }
}
